package org.fanximall.erp.system.interfaces.controller;

import org.fanximall.erp.common.result.Result;
import org.fanximall.erp.system.application.req.DeptQuery;
import org.fanximall.erp.system.application.service.DeptService;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author :  william
 * @version :  V1.0  created in 2024/4/19
 */
@RestController
@RequestMapping("/system/dept")
public class DeptController {

    @Resource
    private DeptService deptService;

    /**
     * 获取部门列表
     */
    @PreAuthorize("@ss.hasPermi('system:dept:list')")
    @GetMapping("/list")
    public Result list(DeptQuery dept)
    {
        return Result.success(deptService.listAllDept(dept));
    }
}
